/* 
 * File:   GradeCriteria.h
 * Author: shemmenw
 *
 * Created on August 3, 2011, 10:46 AM
 */

#ifndef GRADECRITERIA_H
#define	GRADECRITERIA_H

#include "ProjectDefs.h"

struct Grade_Pattern;

class GradeCriteria
{
public:
    enum PatternState
    {
        normal,     //value awarded once per submission
        in_order,   //value must be in the specified order with other patterns
        repeat      //value can be awarded multiple times
    };

    GradeCriteria();
    GradeCriteria(const GradeCriteria& orig);
    virtual ~GradeCriteria();

    bool loadInputFile(const FileType &);
    bool loadPatterns(const FileType &);
    bool load();
    
    const VectorSize getPatternsSize()const;
private:
    Grade_InputVector input;
    Grade_PatternsVector patterns;
    
    mutable Grade_PatternsEarnedVector earned;
};

struct PatternGroup
{
    PatternIDType id;
    PatternPosition position;
};
struct Grade_Pattern
{
    PatternType pattern;
    PatternValue value;
    GradeCriteria::PatternState state;
    PatternGroup group;
};

#endif	/* GRADECRITERIA_H */

